package com.taotao.web.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;

import com.taotao.web.service.IndexPageService;

@Controller
@RequestMapping("/index")
public class IndexPageController {
	
	@Autowired
	private IndexPageService indexPageService;
	
	@RequestMapping(method=RequestMethod.GET)
	public ModelAndView index(){
		ModelAndView mv = new ModelAndView();
		// 大广告
		String AD1 = indexPageService.queryIndexAd1();
		mv.addObject("AD1", AD1);
		// 右上方小广告
		String AD2 = indexPageService.queryIndexAd2();
		mv.addObject("AD2", AD2);
		
		mv.setViewName("index");
		return mv;
	}
	
}














